import { createRouter, createWebHistory } from 'vue-router'
declare module 'vue-router' {
  interface RouteMeta {
    type:
      | 'file-rename'
      | 'folder-rename'
      | 'file-time'
      | 'folder-time'
      | 'file-extract'
      | 'folder-extract'
      | 'folder-batch'
    name:
      | '文件重命名'
      | '文件夹重命名'
      | '文件时间属性'
      | '文件夹时间属性'
      | '提取文件名称'
      | '提取文件夹名称'
      | '批量新建文件夹'
  }
}

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '',
      redirect: '/file-rename'
    },
    {
      name: 'file-rename',
      path: '/file-rename',
      component: () => import('@renderer/views/Router/FileRename/index.vue'),
      meta: { type: 'file-rename', name: '文件重命名' }
    },
    {
      name: 'folder-rename',
      path: '/folder-rename',
      component: () => import('@renderer/views/Router/FolderRename/index.vue'),
      meta: { type: 'folder-rename', name: '文件夹重命名' }
    },
    {
      name: 'file-time',
      path: '/file-file',
      component: () => import('@renderer/views/Router/FileTime/index.vue'),
      meta: { type: 'file-time', name: '文件时间属性' }
    }
  ]
})

export default router
